package com.scoy.honeymei.fragment;

import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.RelativeLayout;
import android.widget.TextView;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;

import com.scoy.honeymei.R;
import com.scoy.honeymei.activity.mall.BookActivity;
import com.scoy.honeymei.activity.mall.MallMeActivity;
import com.scoy.honeymei.activity.mall.TravelMeActivity;
import com.scoy.honeymei.activity.mall.TripMeActivity;
import com.scoy.honeymei.base.BaseFragment;
import com.scoy.honeymei.utils.MyUtil;

import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;
import butterknife.Unbinder;

/**
 * @ClassName: OrderFragment$
 * @Description: 首页 我的订单
 * @Author: GaoZhan
 * @CreateDate: 2019/8/30/0030$ 上午 9:21$
 * @UpdateUser: 更新者
 * @UpdateDate: 2019/8/30/0030$ 上午 9:21$
 * @UpdateRemark: 更新内容
 */
public class OrderFragment extends BaseFragment {

    @BindView(R.id.back_iv)
    ImageView backIv;
    @BindView(R.id.title_tv)
    TextView titleTv;
    @BindView(R.id.sign_tv)
    TextView signTv;
    @BindView(R.id.title_llt)
    LinearLayout titleLlt;
    @BindView(R.id.book_rl)
    RelativeLayout bookRl;
    @BindView(R.id.travel_rl)
    RelativeLayout travelRl;
    @BindView(R.id.out_rl)
    RelativeLayout outRl;
    @BindView(R.id.mall_rl)
    RelativeLayout mallRl;
    private Unbinder unbinder;
    private Context mContext;

    @Nullable
    @Override
    public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
        View view = inflater.inflate(R.layout.fragment_home_order, null, false);
        unbinder = ButterKnife.bind(this, view);
        mContext = getContext();


        initNormal();

        return view;
    }

    @Override
    public void initNormal() {
        backIv.setVisibility(View.GONE);
        titleTv.setText(R.string.myorder);

        titleLlt.setPadding(0, MyUtil.getStatusBarHeight(mContext), 0, 0);

    }

    @OnClick({R.id.book_rl, R.id.travel_rl, R.id.out_rl, R.id.mall_rl})
    public void onViewClicked(View view) {
        switch (view.getId()) {
            case R.id.book_rl:
                startActivity(new Intent(mContext, BookActivity.class));
                break;
            case R.id.travel_rl:
                startActivity(new Intent(mContext, TravelMeActivity.class));
                break;
            case R.id.out_rl:
                startActivity(new Intent(mContext, TripMeActivity.class));
                break;
            case R.id.mall_rl:
                startActivity(new Intent(mContext, MallMeActivity.class));
                break;
        }
    }

    @Override
    public void onDestroyView() {
        super.onDestroyView();
        unbinder.unbind();
    }


}
